<?php
class Default_SvcController extends Zend_Controller_Action 
{    
	public function preDispatch(){
		$this->domain = 'http://'.$_SERVER['SERVER_NAME'];
	}
	
	public function webServiceAction(){ 
		$server = new SoapServer(APPLICATION_PATH."/../data/wsdl/CffSvc.wsdl");
		$server->setClass('Default_Service_Svc');
		$server->handle();		        
    }
	public function wsdl1Action(){
		header("Content-type: text/xml; Charset=utf-8");		
		echo  preg_replace('/http:\/\/www\.chinafulfill\.com/', $this->domain, file_get_contents(APPLICATION_PATH."/../data/wsdl/CffSvc.wsdl"));	
	}
	
	public function testAction(){	
		$apiUrl= $this->domain.'/default/svc/wsdl1';
		$client =   new SoapClient($apiUrl,array('trace' => 1,'exceptions' => 1,'encoding' => 'UTF-8'));
		
		$req = array('AsnCode'=>'RA0256120530010',"AsnStatus"=>1,
				'HeaderRequest'=>array('customerId'=>'A0256','appToken'=>'asdffffffffffffffffffffffffasdfasdfasdfasdfasdfaffffffffffffffffffffffffffffffddddddddddddddddd','appKey'=>'ffdddfdfdeaadffffffffffffffasdf'));
		
		$result = $client->updateAsnStatus($req);		
		var_dump($result);exit;
		
	}	
	
}